@echo off
echo Starting OCR API Server...
echo.

REM Check if virtual environment exists
if not exist "venv\" (
    echo Creating virtual environment...
    python -m venv venv
    echo.
)

REM Activate virtual environment
echo Activating virtual environment...
call venv\Scripts\activate.bat

REM Install requirements
echo Installing requirements...
pip install -r requirements.txt

REM Start the server
echo.
echo Starting FastAPI server...
echo Server will be available at: http://localhost:8001
echo API documentation at: http://localhost:8001/docs
echo.
python main.py

pause